
<script
	src="<?= base_url(); ?>third_party/ckeditor/ckeditor.js"></script>


<section class="wrapper">
	<!-- page start-->
	<section class="panel">
		<header class="panel-heading"> NEWS MANAGEMENT </header>
		<div class="panel-body">
			<form class="form-horizontal" role="form" name="news" method="POST"
				action="<?= base_url(); ?>news/admin/admin_news/submit_news">
				<?php
				$this->session->flashdata('message'); {
					$msg = $this->session->flashdata('message');
					echo '<font color="red">' . $msg . '</font>';
				}
				?>
				<div class="form-group">
					<label for="input" class="col-lg-2 control-label">Title</label>
					<div class="col-lg-8">
						<input type="text" class="form-control" id="title" name="title"
							placeholder="Title">
					</div>
				</div>


				<div class="form-group">
					<label for="input" class="col-lg-2 control-label">Meta Title</label>
					<div class="col-lg-8">
						<input type="text" class="form-control" id="meta_title" name="meta_title"
							placeholder="Title">
					</div>
				</div>

				<div class="form-group">
					<label for="input" class="col-lg-2 control-label">Meta Keyword</label>
					<div class="col-lg-8">
						<textarea name="meta_keyword" id="meta_keyword" class="form-control" rows="3"></textarea>
					</div>
				</div>

				<div class="form-group">
					<label for="input" class="col-lg-2 control-label">Meta Description</label>
					<div class="col-lg-8">
						<textarea name="meta_description" id="meta_description" class="form-control" rows="3"></textarea>
					</div>
				</div>

				<div class="form-group">
					<label for="input" class="col-lg-2 control-label">Desciption</label>
					<div class="col-lg-8">

						<textarea class="form-control ckeditor" id="news_details" name="news_detail" rows="6"></textarea>
<script type="text/javascript">
                            CKEDITOR.replace( 'news_details',
                            {
                                skin : 'v2',
                                enterMode : CKEDITOR.ENTER_BR,
                                toolbar :
                                    [
                                    [ 'Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink' ],
                                    [ 'UIColor' ]
                                ]

                            });
                        </script>
					</div>
				</div>

				<div class="form-group">
					<div class="col-lg-offset-2 col-lg-8">
						<input type="submit" class="btn btn-info pull-right" value="Add News" name="insert_news" <?php if($this->config->item('mode')=='DEMO'){?>onclick="alert ('Sorry! Not allowed in demo mode '); return false;" <?} else?>onclick="return confirm('Are you sure ?');"  >
					</div>
				</div>


			</form>
		</div>
		<!-- End of Body Panel -->
	</section>
	
	<section class="panel">
					<header class="panel-heading"> NEWS MANAGEMENT   </header>
					<div class="panel-body">
						<table class="table table-striped table-advance table-hover">
							<thead>
								<tr>
									<th><i class="icon-bullhorn"></i> Posted On</th>
									<th class="hidden-phone "><i class="icon-bookmark"></i>
										Title</th>
									
									<th><i class=" icon-edit"></i> Action</th>
								</tr>
							</thead>
							<tbody>
							<?php foreach ($news['all'] as $news) : ?>
								<tr>
									<th><?= $news->posted_on;?></th>
									<td class="hidden-phone"><?= substr($news->title,0,200);?></td>
									
									<td>
									
									
										<a href="<?= base_url(); ?>news/admin/admin_news/edit_news/<?= $news->id; ?>" data-toggle="tooltip" title="Edit" onclick="return confirm('Are you sure you want to Edit?')">
										<button class="btn btn-primary btn-xs">
											<i class="icon-pencil"></i>
										</button>
										</a>
										<a href="<?= base_url(); ?>news/admin/admin_news/delete_news/<?= $news->id; ?>" <?php if($this->config->item('mode')=='DEMO'){?>onclick="alert ('Sorry! Demo mode '); return false;" <?} else?>onclick="return confirm('Are you sure ?');"  data-toggle="tooltip" title="Delete">
										<button class="btn btn-danger btn-xs">
											<i class="icon-trash "></i>
										</button>
										</a>
									</td>
								</tr>
								<?php endforeach;?>
								
							</tbody>
						</table>

						<div class="row"><div class="col-sm-6"></div><div class="col-sm-6"><div class="dataTables_paginate paging_bootstrap pagination">
						<ul>
						<li>
						<?php  echo $this->pagination->create_links(); ?>
						</li>
						</ul></div></div></div>
						
					</div>
					<!-- End of Body Panel -->
				</section>
	<!-- page end-->
</section>
